<template>
  <view class="cover-container">
    <image class="cover-bg" src="/static/cover-bg.png" mode="aspectFill"/>
    <view class="title">时光花园</view>
    <view class="subtitle">记录你的每一天</view>
    <view class="start-btn" @tap="handleStart">开启旅程</view>
  </view>
</template>

<script>
export default {
  onLoad() {
    // 检查是否首次进入
    const isFirstTime = !uni.getStorageSync('hasVisited')
    if (!isFirstTime) {
      // 不是首次进入，直接跳转到主页
      uni.redirectTo({
        url: '/pages/index/index'
      })
    }
  },
  
  methods: {
    handleStart() {
      // 设置访问标记
      uni.setStorageSync('hasVisited', true)
      uni.navigateTo({
        url: '/pages/guide/index'
      })
    }
  }
}
</script>

<style lang="scss">
.cover-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  
  .cover-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
  }
  
  .title {
    font-size: 48rpx;
    color: #fff;
    margin-bottom: 20rpx;
  }
  
  .subtitle {
    font-size: 28rpx;
    color: rgba(255,255,255,0.8);
    margin-bottom: 100rpx;
  }
  
  .start-btn {
    padding: 20rpx 60rpx;
    background: rgba(255,255,255,0.2);
    border-radius: 100rpx;
    color: #fff;
    font-size: 32rpx;
  }
}
</style> 